package com.group02.community.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group02.community.entity.dept.SysDept;
import com.group02.community.entity.vo.UserDeptVO;
import com.group02.community.mapper.DeptMapper;
import com.group02.community.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, SysDept> implements IDeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<SysDept> selectAllDept() {
        return deptMapper.selectAllDept();
    }

    @Override
    public void delete(Long id) {
        deptMapper.delete(id);
    }

    @Override
    public List<SysDept> getQueryPage(String deptName, String status) {
        return deptMapper.getQueryPage(deptName,status);
    }

    @Override
    public List<UserDeptVO> getAllDept() {
        return deptMapper.selectAllUserDept();
    }

    @Override
    public Long checkDeptExistUser(Long id) {
        return deptMapper.checkDeptExistUser(id);
    }

    @Override
    public Long hasChildByDeptId(Long id) {
        return deptMapper.hasChildByDeptId(id);
    }

    @Override
    public Long selectNormalChildrenDeptById(Long id) {
        return deptMapper.selectNormalChildrenDeptById(id);
    }


}
